package com.mooc.apigateway.service;

import com.mooc.apigateway.dao.CommentDao;
import com.mooc.apigateway.model.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentService {

 @Autowired
 private CommentDao commentDao;

    public List<Comment> getHouseComments(Long houseId){
     return commentDao.getHouseComments(houseId);
 }

    public void addHouseComment(Long houseId, String content, Long userId) {
        Comment comment = new Comment();
        comment.setHouseId(houseId);
        comment.setContent(content);
        comment.setUserId(userId);
        commentDao.addHouseComment(comment);
    }



}
